clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

** RUN THE ANALYSES
* Physical sanctions, sociodemographics
regr intent_phis_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_phis_sociodem

* Physical sanctions, attitudes and emotions
regr intent_phis_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_phis_attitudes

* Verbal sanctions, sociodemographics 
regr intent_verb_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_verbal_sociodem

* Verbal sanctions, attitudes and emotions
regr intent_verb_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_verbal_attitudes

* Insult, sociodemographics 
regr intent_insult_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_insult_sociodem

* Insult, attitudes and emotions
regr intent_insult_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_insult_attitudes

* PCA direct sanctions, sociodemographics 
regr pca_direct female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_direct_sociodem

* PCA direct sanctions, attitudes and emotions
regr pca_direct left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_direct_attitudes

* Deny help, sociodemographics 
regr intent_deny_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_deny_sociodem

* Deny help, attitudes and emotions
regr intent_deny_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_deny_attitudes

* Avoid Interaction, sociodemographics 
regr intent_avoid_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_avoid_sociodem

* Avoid Interaction, attitudes and emotions
regr intent_avoid_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_avoid_attitudes

* Gossip, sociodemographics 
regr intent_gossip_vox_num female_dummy age_calculated college spanish vox_vote_ccaa, r
est store vox_gossip_sociodem

* Gossip, attitudes and emotions
regr intent_gossip_vox_num left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store vox_gossip_attitudes

* PCA indirect sanctions, sociodemographics 
regr pca_indirect female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_indirect_sociodem

* PCA indirect sanctions, attitudes and emotions
regr pca_indirect left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_indirect_attitudes

* PCA all sanctions, sociodemographics 
regr pca_all female_dummy age_calculated college spanish vox_vote_ccaa, r
est store pca_all_sociodem

* PCA all sanctions, attitudes and emotions
regr pca_all left_right_self pol_interest anger_vox_num disgust_vox_num  ///
fear_vox_num sad_vox_num, r
est store pca_all_attitudes

* Make table
esttab vox_phis_sociodem vox_phis_attitudes vox_verbal_sociodem vox_verbal_attitudes vox_insult_sociodem vox_insult_attitudes pca_direct_sociodem pca_direct_attitudes vox_gossip_sociodem vox_gossip_attitudes ///
vox_deny_sociodem vox_deny_attitudes vox_avoid_sociodem vox_avoid_attitudes ///
pca_indirect_sociodem pca_indirect_attitudes  pca_all_sociodem pca_all_attitudes  ///
using tables/table3.tex, tex nonumber ///
mtitles("Physical" "Physical" "Verbal" "Verbal" "Insult" "Insult"  "Dir sanct (PCA)" "Dir sanct (PCA)" "Gossip" "Gossip" "Deny help" "Deny help" "Avoid interact" "Avoid interact" "Ind sanct (PCA)" "Ind sanct (PCA)" "All sanctions (PCA)" "All sanctions (PCA)" ) ///
coeflabels(left_right_self "Left-right self placement" vox_vote_ccaa "Vox vote in Region" ///
female_dummy "Female (dummy)" age_calculated "Age" college "College" spanish "Spanish" ///
pol_interest "Political interest" happy_vox_num "Happiness" ///
anger_vox_num "Anger" disgust_vox_num "Disgust" fear_vox_num "Fear" sad_vox_num "Sadness" _cons "Constant") se ///
replace addnotes("Standard errors are robust")
